package hashset03;
/*

 */
public class Person {
    private String name;
    private int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public int hashCode() {
        System.out.println(this.name+"hashCode方法被调用");
        return 0;
    }

    @Override
    public boolean equals(Object obj) {
        Person p = (Person) obj;
        System.out.println(this.name+" "+p.name+"equals方法被调用 ");
        //return false;
        return true;
    }
}
